@echo off
REM 检查服务运行状态脚本

echo ==========================================
echo 检查服务运行状态
echo ==========================================
echo.

echo [1/2] 检查后端服务 (http://localhost:8000)...
powershell -Command "try { $response = Invoke-WebRequest -Uri 'http://localhost:8000/api/' -TimeoutSec 2 -UseBasicParsing; Write-Host '  ✅ 后端服务运行正常 (HTTP' $response.StatusCode ')' -ForegroundColor Green } catch { Write-Host '  ❌ 后端服务未运行' -ForegroundColor Red; Write-Host '     启动命令: scripts\start_backend.bat' }"

echo.
echo [2/2] 检查前端服务 (http://localhost:8080)...
powershell -Command "try { $response = Invoke-WebRequest -Uri 'http://localhost:8080' -TimeoutSec 2 -UseBasicParsing; Write-Host '  ✅ 前端服务运行正常 (HTTP' $response.StatusCode ')' -ForegroundColor Green } catch { Write-Host '  ❌ 前端服务未运行' -ForegroundColor Red; Write-Host '     启动命令: scripts\start_frontend.bat' }"

echo.
echo ==========================================
echo 检查完成
echo ==========================================
echo.
pause

